<template>
  <div class="bento-grid">
    <!-- 大标题展示 -->
    <custom-bento-item />

    <!-- 网格布局容器 -->
    <transition-group name="fade-up" appear>
      <security-bento :key="1" />
      <vulnerability-bento :key="2" />
      <attack-type-bento :key="3" />
      <attack-phase-bento :key="4" />
      <fix-suggestions-bento :key="5" />
      <linux-binary-bento :key="6" />
      <log-cleanup-bento :key="7" />
      <command-alert-bento :key="8" />
    </transition-group>
  </div>
</template>

<script setup>
import CustomBentoItem from './CustomBentoItem.vue'
import SecurityBento from './SecurityBento.vue'
import VulnerabilityBento from './VulnerabilityBento.vue'
import AttackTypeBento from './AttackTypeBento.vue'
import AttackPhaseBento from './AttackPhaseBento.vue'
import FixSuggestionsBento from './FixSuggestionsBento.vue'
import LinuxBinaryBento from './LinuxBinaryBento.vue'
import LogCleanupBento from './LogCleanupBento.vue'
import CommandAlertBento from './CommandAlertBento.vue'
</script>

<style lang="scss" scoped>
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #0f172a;
  min-height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

// 统一基础样式
.bento-item {
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  
  &::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image: linear-gradient(to right, #fff 1px, transparent 1px),
                      linear-gradient(to bottom, #fff 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
  }
  
  &:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 20px rgba(41, 98, 255, 0.2);
  }
}

// 标题统一样式
.bento-item__title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  position: relative;
  padding: 0 1.5rem;
  text-shadow: 0 0 4px #000;
  background-image: linear-gradient(90deg, transparent 70%, rgba(255,255,255,0.03) 30%);
  padding-right: 20px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-item__title {
    font-size: 1.125rem;
  }
}

/* 过渡动画 */
.fade-up-enter-active {
  transition: all 0.6s ease;
}

.fade-up-enter-from {
  transform: translateY(20px);
  opacity: 0;
}

.fade-up-enter-to {
  transform: translateY(0);
  opacity: 1;
}
</style>